package com.cgg.stock.user.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cgg.stock.common.pojo.User;
import com.cgg.stock.user.vo.LoginBean;
import com.cgg.stock.user.vo.RegisterBean;
import com.cgg.stock.user.vo.dto.UserInfoDTO;

import java.math.BigDecimal;

public interface UserService extends IService<User> {

    /**
     * 进行登录
     * @param loginBean
     */
    String login(LoginBean loginBean) throws Exception;

    /**
     * 根据名字查询
     */
    User queryByName(String username);

    /**
     * 获得账户的余额
     * @param phone
     * @return
     */
    BigDecimal getAccountBalance(Long phone);




    /**
     * 改变账户余额
     * @param account
     * @param amount
     * @param count
     * @return
     */
    int updateAccountBalance(Long account, BigDecimal amount, int count);

    /**
     * 获取用户信息
     * @param account
     * @return
     */
    UserInfoDTO getUserInfo(String account);

    /**
     * 用户注册
     * @param registerBean
     */
    int register(RegisterBean registerBean);

    /**
     * 根据手机号获取用户
     * @param userAccount
     */
    User queryUserByAccount(Long userAccount);
}

